<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%
	String btnVal = "";
	String mode = "";
	
	if (request.getParameter("seq") == null) {
		btnVal = "글쓰기";
		mode = "insert";
	} else {
		btnVal = "수정";
		mode = "modify";
	}
%>

<%@ include file = "/inc/header.jsp" %>

<form method="post" action="boardWrite.do">
<input type="hidden" name="seq" id="seq" value="${boardDto.SEQ }" />
<input type="hidden" name="mode" id="mode" value="<%=mode %>" />
<table width="500" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr>
	<td width="150" bgcolor="#EFEFEF" align="center">글쓴이</td>
	<td bgcolor="#FFFFFF">
		<input type="text" name="WRITER" id="WRITER" value="${boardDto.WRITER }" size="20" />
	</td>
</tr>
<% if ("insert".equals(mode)) { %>
<tr>
	<td width="150" bgcolor="#EFEFEF" align="center">비밀번호</td>
	<td bgcolor="#FFFFFF">
		<input type="PASSWORD" name="PASSWORD" id="PASSWORD" size="20" />
	</td>
</tr>
<% } %>
<tr>
	<td width="150" bgcolor="#EFEFEF" align="center">제목</td>
	<td bgcolor="#FFFFFF">
		<input type="text" name="TITLE" id="TITLE" value="${boardDto.TITLE }" />
	</td>
</tr>
<tr>
	<td colspan="2" bgcolor="#FFFFFF">
		<textarea name="CONTENT" id="CONTENT" rows="5" style="width:95%;">${boardDto.CONTENT }</textarea>
	</td>
</tr>
<tr>
	<td colspan="2" align="right" bgcolor="#FFFFFF">
		<input type="button" value="<%=btnVal%>" onclick="this.form.submit();" />
		<input type="button" value="목록" onclick="location.href='boardList.do';" />
	</td>
</tr>
</table>
</form>

<%@ include file = "/inc/footer.jsp" %>
